<template>
    <div>
        <h1>6. keeplive下组件激活状态函数 </h1>
        <p>{{num}}</p>
        <button @click="num++">++</button>
    </div>
</template>

<script>
export default {
    name:'',
    components: {

    },
    props: {

    },
    data() {
        return {
            num:10
        };
    },
    methods: {

    },
    watch: {

    },
    created() {
        console.log('组件被创建')
    },
    destroyed() {
        console.log('组件被销毁')
    },
    // activated deactivated  生命周期函数，是keep-live元素特有的
    activated() {
        console.log('activated---组件被激活')
    },
    deactivated() {
        console.log('activated---组件取消激活')
    }
};
</script>

<style scoped lang="less">

</style>
